package cn.edu.bitc;

public class Main {

    public static void main(String[] args) {
        try {
            // 加法
            double sum = Calculator.add(5, 3);
            System.out.println("Sum: " + sum);

            // 减法
            double difference = Calculator.subtract(10, 4);
            System.out.println("Difference: " + difference);

            // 乘法
            double product = Calculator.multiply(6, 7);
            System.out.println("Product: " + product);

            // 除法
            double quotient = Calculator.divide(20, 4);
            System.out.println("Quotient: " + quotient);

            // 尝试除以零，这应该抛出异常
            quotient = Calculator.divide(10, 0);
            System.out.println("Quotient when dividing by zero: " + quotient);

        } catch (IllegalArgumentException e) {
            System.err.println(e.getMessage());
        }
    }
}
